#!/bin/csh -f
#
# Concatenates a list of dbas files.
# Arguments: idents (subdirectories in $DIR)
# If no arguments are given, all available subdirectories are processed

set DIR = /usr/elephant/pdb-nmr/data_paper_allg
#set DIR = /nmr9/mia/pdb_nmr
chdir $DIR

set fil = "dbas"

if ( $#argv == 0 ) then
    set list = ( `ls` )
else
    switch ( "$argv[1]" )
	case "-f":
	    shift
	    set fil = $argv[1]
	    shift
	    breaksw
	default:
	    breaksw
    endsw
    if ( $#argv == 0 ) then
	set list = ( `ls` )
    else
	set list = ( $argv[*] )
    endif
endif
foreach x ( $list )
    cat $x/$x.$fil
end
